<template>
  <el-dialog title="会员修改" :visible.sync="info.isShow">
    <el-form :model="form">
      <el-form-item label="手机号" :label-width="formLabelWidth">
        <el-input v-model="form.phone" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="昵称" :label-width="formLabelWidth">
        <el-input v-model="form.nickname" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="密码" :label-width="formLabelWidth">
        <el-input v-model="form.password" autocomplete="off"></el-input>
      </el-form-item>

      <el-form-item label="状态" :label-width="formLabelWidth">
        <el-switch
          v-model="form.status"
          active-color="green"
          inactive-color="grey"
          :active-value="1"
          :inactive-value="2"
        ></el-switch>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="cancel">取 消</el-button>
      <!-- <el-button v-if="info.isAdd" type="primary" @click="comfirm">确 定</el-button> -->
      <el-button type="primary" @click="update">修 改</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { mapGetters, mapActions } from "vuex";
export default {
  props: ["info"],
  data() {
    return {
      formLabelWidth: "120px"
    };
  },
  methods: {
    cancel(){
       this.info.isShow = false;
    },
    update(){
      this.updatemember(this.form)
      this.cancel()
    },
    oneMember(uid){
      this.requestOne(uid)
    },
    ...mapActions({
      requestOne:"member/oneActions",
      updatemember:"member/updateActions"
    })
  },
  computed: {
    ...mapGetters({
      form: "member/form"
    })
  }
};
</script>

<style>
</style>